package com.frinder.base.akka;

import akka.actor.AbstractActor;
import akka.actor.DeadLetter;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @ClassName DeadLetterActor
 * @Author frinder
 * @Description akka 死信处理类
 * @Date 2019/1/19 16:23
 * @Version 1.0
 */
@Component
@Scope("prototype")
public class DeadLetterActor extends BaseActor {

    @Override
    public AbstractActor.Receive createReceive() {
        return receiveBuilder()
                .match(DeadLetter.class, msg -> log().error("*** DeadLetter : {}", msg))
                .build();
    }

}
